package study;

import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * @version 1.0
 * @since:
 * @ClassName:TreeMapTest
 * @author: Li Jiahui
 * @date: 2021-05-05 10:28
 */
public class TreeMapTest {
    public static void main(String[] args) {
        //1.准备一个TreeSet集合并打印
        Set<String> tm1 = new TreeSet<>();
        System.out.println("tm1 = " + tm1);
        //2.向tm1集合中添加元素并打印
        tm1.add("aa");
        System.out.println("tm1 = " + tm1);

        tm1.add("ee");
        System.out.println("tm1 = " + tm1);

        tm1.add("ff");
        System.out.println("tm1 = " + tm1);

        tm1.add("cc");
        System.out.println("tm1 = " + tm1);

        tm1.add("bb");
        System.out.println("tm1 = " + tm1);

        tm1.add("dd");
        System.out.println("tm1 = " + tm1);

        Set<Student> s1 = new TreeSet<>();
        s1.add(new Student("lijiahui", 35));
        s1.add(new Student("xunlingling", 37));
        s1.add(new Student("lizixuan",8));
        s1.add(new Student("lianxuan", 6));
        System.out.println("s1 =" + s1);
    }
}
